﻿<UserControl
    x:Class="LenovoLegionToolkit.WPF.Controls.Dashboard.SensorsControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:behaviors="clr-namespace:LenovoLegionToolkit.WPF.Behaviors"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:resources="clr-namespace:LenovoLegionToolkit.WPF.Resources"
    xmlns:wpfui="http://schemas.lepo.co/wpfui/2022/xaml"
    d:DesignHeight="450"
    d:DesignWidth="800"
    mc:Ignorable="d">
    <wpfui:CardControl>
        <wpfui:CardControl.Header>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" SharedSizeGroup="A" />
                    <ColumnDefinition Width="*" SharedSizeGroup="B" />
                    <ColumnDefinition Width="70" SharedSizeGroup="C" />
                    <ColumnDefinition Width="16" />
                    <ColumnDefinition Width="Auto" SharedSizeGroup="A" />
                    <ColumnDefinition Width="*" SharedSizeGroup="B" />
                    <ColumnDefinition Width="70" SharedSizeGroup="C" />
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>

                <TextBlock
                    Grid.ColumnSpan="3"
                    Margin="0,0,0,8"
                    FontSize="18"
                    FontWeight="Medium"
                    Text="{x:Static resources:Resource.SensorsControl_CPU_Title}" />

                <Label
                    Grid.Row="1"
                    Grid.Column="0"
                    VerticalContentAlignment="Center"
                    Content="{x:Static resources:Resource.SensorsControl_Utilization_Title}"
                    Foreground="{DynamicResource TextFillColorPrimaryBrush}" />
                <ProgressBar
                    x:Name="_cpuUtilizationBar"
                    Grid.Row="1"
                    Grid.Column="1"
                    Margin="16,0,16,0"
                    Maximum="100"
                    Minimum="0"
                    Value="0">
                    <i:Interaction.Behaviors>
                        <behaviors:ProgressBarAnimateBehavior />
                    </i:Interaction.Behaviors>
                </ProgressBar>
                <Label
                    x:Name="_cpuUtilizationLabel"
                    Grid.Row="1"
                    Grid.Column="2"
                    HorizontalContentAlignment="Right"
                    VerticalContentAlignment="Center"
                    Content="-"
                    Foreground="{DynamicResource TextFillColorSecondaryBrush}" />

                <Label
                    Grid.Row="2"
                    Grid.Column="0"
                    VerticalContentAlignment="Center"
                    Content="{x:Static resources:Resource.SensorsControl_CoreClock_Title}"
                    Foreground="{DynamicResource TextFillColorPrimaryBrush}" />
                <ProgressBar
                    x:Name="_cpuCoreClockBar"
                    Grid.Row="2"
                    Grid.Column="1"
                    Margin="16,0,16,0"
                    Maximum="100"
                    Minimum="0"
                    Value="0">
                    <i:Interaction.Behaviors>
                        <behaviors:ProgressBarAnimateBehavior />
                    </i:Interaction.Behaviors>
                </ProgressBar>
                <Label
                    x:Name="_cpuCoreClockLabel"
                    Grid.Row="2"
                    Grid.Column="2"
                    HorizontalContentAlignment="Right"
                    VerticalContentAlignment="Center"
                    Content="-"
                    Foreground="{DynamicResource TextFillColorSecondaryBrush}" />

                <Label
                    Grid.Row="3"
                    Grid.Column="0"
                    VerticalContentAlignment="Center"
                    Content="{x:Static resources:Resource.SensorsControl_Temperature_Title}"
                    Foreground="{DynamicResource TextFillColorPrimaryBrush}" />
                <ProgressBar
                    x:Name="_cpuTemperatureBar"
                    Grid.Row="3"
                    Grid.Column="1"
                    Margin="16,0,16,0"
                    Maximum="100"
                    Minimum="0"
                    Value="0">
                    <i:Interaction.Behaviors>
                        <behaviors:ProgressBarAnimateBehavior />
                    </i:Interaction.Behaviors>
                </ProgressBar>
                <Label
                    x:Name="_cpuTemperatureLabel"
                    Grid.Row="3"
                    Grid.Column="2"
                    HorizontalContentAlignment="Right"
                    VerticalContentAlignment="Center"
                    Content="-"
                    Foreground="{DynamicResource TextFillColorSecondaryBrush}"
                    MouseLeftButtonDown="TemperatureLabel_Click" />

                <Label
                    Grid.Row="4"
                    Grid.Column="0"
                    Content="{x:Static resources:Resource.SensorsControl_Fan_Title}"
                    Foreground="{DynamicResource TextFillColorPrimaryBrush}" />
                <ProgressBar
                    x:Name="_cpuFanSpeedBar"
                    Grid.Row="4"
                    Grid.Column="1"
                    Margin="16,0,16,0"
                    Maximum="100"
                    Minimum="0"
                    Value="0">
                    <i:Interaction.Behaviors>
                        <behaviors:ProgressBarAnimateBehavior />
                    </i:Interaction.Behaviors>
                </ProgressBar>
                <Label
                    x:Name="_cpuFanSpeedLabel"
                    Grid.Row="4"
                    Grid.Column="2"
                    HorizontalContentAlignment="Right"
                    Content="-"
                    Foreground="{DynamicResource TextFillColorSecondaryBrush}" />

                <TextBlock
                    Grid.Row="0"
                    Grid.Column="4"
                    Margin="0,0,0,8"
                    FontSize="18"
                    FontWeight="Medium"
                    Text="{x:Static resources:Resource.SensorsControl_GPU_Title}" />

                <Label
                    Grid.Row="1"
                    Grid.Column="4"
                    VerticalContentAlignment="Center"
                    Content="{x:Static resources:Resource.SensorsControl_Utilization_Title}"
                    Foreground="{DynamicResource TextFillColorPrimaryBrush}" />
                <ProgressBar
                    x:Name="_gpuUtilizationBar"
                    Grid.Row="1"
                    Grid.Column="5"
                    Margin="16,0,16,0"
                    Maximum="100"
                    Minimum="0"
                    Value="0">
                    <i:Interaction.Behaviors>
                        <behaviors:ProgressBarAnimateBehavior />
                    </i:Interaction.Behaviors>
                </ProgressBar>
                <Label
                    x:Name="_gpuUtilizationLabel"
                    Grid.Row="1"
                    Grid.Column="6"
                    HorizontalContentAlignment="Right"
                    VerticalContentAlignment="Center"
                    Content="-"
                    Foreground="{DynamicResource TextFillColorSecondaryBrush}" />

                <Label
                    Grid.Row="2"
                    Grid.Column="4"
                    VerticalContentAlignment="Center"
                    Content="{x:Static resources:Resource.SensorsControl_CoreClock_Title}"
                    Foreground="{DynamicResource TextFillColorPrimaryBrush}" />
                <ProgressBar
                    x:Name="_gpuCoreClockBar"
                    Grid.Row="2"
                    Grid.Column="5"
                    Margin="16,0,16,0"
                    Maximum="100"
                    Minimum="0"
                    Value="0">
                    <i:Interaction.Behaviors>
                        <behaviors:ProgressBarAnimateBehavior />
                    </i:Interaction.Behaviors>
                </ProgressBar>
                <Label
                    x:Name="_gpuCoreClockLabel"
                    Grid.Row="2"
                    Grid.Column="6"
                    HorizontalContentAlignment="Right"
                    VerticalContentAlignment="Center"
                    Content="-"
                    Foreground="{DynamicResource TextFillColorSecondaryBrush}" />

                <Label
                    Grid.Row="3"
                    Grid.Column="4"
                    VerticalContentAlignment="Center"
                    Content="{x:Static resources:Resource.SensorsControl_MemoryClock_Title}"
                    Foreground="{DynamicResource TextFillColorPrimaryBrush}" />
                <ProgressBar
                    x:Name="_gpuMemoryClockBar"
                    Grid.Row="3"
                    Grid.Column="5"
                    Margin="16,0,16,0"
                    Maximum="100"
                    Minimum="0"
                    Value="0">
                    <i:Interaction.Behaviors>
                        <behaviors:ProgressBarAnimateBehavior />
                    </i:Interaction.Behaviors>
                </ProgressBar>
                <Label
                    x:Name="_gpuMemoryClockLabel"
                    Grid.Row="3"
                    Grid.Column="6"
                    HorizontalContentAlignment="Right"
                    VerticalContentAlignment="Center"
                    Content="-"
                    Foreground="{DynamicResource TextFillColorSecondaryBrush}"
                    MouseUp="TemperatureLabel_Click" />

                <Label
                    Grid.Row="4"
                    Grid.Column="4"
                    VerticalContentAlignment="Center"
                    Content="{x:Static resources:Resource.SensorsControl_Temperature_Title}"
                    Foreground="{DynamicResource TextFillColorPrimaryBrush}" />
                <ProgressBar
                    x:Name="_gpuTemperatureBar"
                    Grid.Row="4"
                    Grid.Column="5"
                    Margin="16,0,16,0"
                    Maximum="100"
                    Minimum="0"
                    Value="0">
                    <i:Interaction.Behaviors>
                        <behaviors:ProgressBarAnimateBehavior />
                    </i:Interaction.Behaviors>
                </ProgressBar>
                <Label
                    x:Name="_gpuTemperatureLabel"
                    Grid.Row="4"
                    Grid.Column="6"
                    HorizontalContentAlignment="Right"
                    VerticalContentAlignment="Center"
                    Content="-"
                    Foreground="{DynamicResource TextFillColorSecondaryBrush}"
                    MouseDown="TemperatureLabel_Click" />

                <Label
                    Grid.Row="5"
                    Grid.Column="4"
                    Content="{x:Static resources:Resource.SensorsControl_Fan_Title}"
                    Foreground="{DynamicResource TextFillColorPrimaryBrush}" />
                <ProgressBar
                    x:Name="_gpuFanSpeedBar"
                    Grid.Row="5"
                    Grid.Column="5"
                    Margin="16,0,16,0"
                    Maximum="100"
                    Minimum="0"
                    Value="0">
                    <i:Interaction.Behaviors>
                        <behaviors:ProgressBarAnimateBehavior />
                    </i:Interaction.Behaviors>
                </ProgressBar>
                <Label
                    x:Name="_gpuFanSpeedLabel"
                    Grid.Row="5"
                    Grid.Column="6"
                    HorizontalContentAlignment="Right"
                    Content="-"
                    Foreground="{DynamicResource TextFillColorSecondaryBrush}" />

            </Grid>
        </wpfui:CardControl.Header>
    </wpfui:CardControl>
</UserControl>
